<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>맛집 세상 관리자</title>

<script type="text/javascript">
function sss(){
	alert("ddd");
}
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:1406277561,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dokv=88e434a982/"},atok:"c7408377f8f729eb5c451d460f3aaf80",petok:"44b6327855218ebc5243c7fc25194885ef00fd86-1406957797-1800",zone:"adbee.technology",rocket:"0",apps:{"ga_key":{"ua":"UA-49262924-2","ga_bs":"2"}}}];!function(a,b){a=document.createElement("script"),b=document.getElementsByTagName("script")[0],a.async=!0,a.src="../ajax.cloudflare.com/cdn-cgi/nexp/dokv%3d97fb4d042e/cloudflare.min.js",b.parentNode.insertBefore(a,b)}()}}catch(e){};
//]]>
</script>
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />

<link href="css/libs/font-awesome.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="css/libs/nanoscroller.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/compiled/layout.css">
<link rel="stylesheet" type="text/css" href="css/compiled/elements.css">

<link rel="stylesheet" href="css/libs/daterangepicker.css"
	type="text/css" />

<link type="image/x-icon" href="favicon.png" rel="shortcut icon" />

<link
	href='http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400'
	rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
		<script src="js/html5shiv.js"></script>
		<script src="js/respond.min.js"></script>
	<![endif]-->
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-49262924-2']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
/* ]]> */
</script>
</head>
<body>

	<%-- 상 단 --%>
	<jsp:include page="../include/top.jsp"></jsp:include>
	<%-- 상 단 끝 --%>

	<div id="content-wrapper">
		<div class="row">
			<div class="col-lg-12">
				<div class="row">
					<div class="col-lg-12">
						<ol class="breadcrumb">
							<li><a href="#">Home</a></li>
							<li class="active"><span>Notice</span></li>
						</ol>
						<div class="row">
							<div class="col-lg-12">
								<div class="main-box clearfix">
									<header class="main-box-header clearfix">
									<h2 class="pull-left">공 지 사 항</h2>
									<div class="filter-block pull-right">
										<div class="form-group pull-left">
											<select class="btn btn-success dropdown-toggle"
												data-toggle="dropdown">
													<option value="subject">category</option>
                               						 <option value="subject1">제목</option>
                                					<option value="content">내용</option>
											</select>
										</div>
										<div class="form-group pull-left">
											<input type="text" class="form-control" value="찾기...">
										 <a href="" onclick="">
										 <i class="fa fa-search search-icon" onclick="javascript:sss();"></i> 
										</a>
										</div>
										<a href="noticeInsert.do" class="btn btn-primary pull-right"> 
											<i class="fa fa-plus-circle fa-lg"></i> 글 추가
										</a>
									</div>
									</header>
									<div class="main-box-body clearfix">
										<div class="table-responsive"> 
											<table class="table">
												<thead>
													<tr>
														<th class="text-center">번호</th>
														<th><a href="#"><span>글 제목</span></a></th>
														<th class="text-right"><a href="#" class="asc"><span>글쓴이</span></a></th>
														<th class="text-center"><a href="#" class="desc"><span>수정
																	날짜</span></a></th>
														<th>&nbsp;</th>
													</tr>
												</thead>
												<c:choose>
												<c:when test="${totalArticle==0}">
												<table border="1" width="700" cellspacing="0" cellpadding="1" align="center">
													<tr align="center">
														<td>게시판에 저장된 글이 없습니다.</td>
													</tr>
												</table>
												</c:when>
												<c:otherwise>
												<tbody>
												<c:forEach var="notice" items="${noticeList}">
													<c:choose>
													<c:when test="${notice.topview==1}">
													<tr>
														<td class="text-center">
														<img alt="top공지글" src="<%=request.getContextPath()%>/img/board/icon_notice.gif"/>
														</td>
														<td>${notice.subject}</td>
														<td class="text-right">${notice.name}</td>
														<td class="text-center">${notice.regdate}</td>
														<td style="width: 15%;"><a href="#"
															class="table-link"> <span class="fa-stack"> <i
																	class="fa fa-square fa-stack-2x"></i> <i
																	class="fa fa-search-plus fa-stack-1x fa-inverse"></i>
															</span>
														</a> <a href="#" class="table-link"> <span
																class="fa-stack"> 
																<i
																	class="fa fa-square fa-stack-2x"></i> <i
																	class="fa fa-pencil fa-stack-1x fa-inverse"></i>
															</span>
														</a> <a href="#" class="table-link danger"> <span
																class="fa-stack"> <i
																	class="fa fa-square fa-stack-2x"></i> <i
																	class="fa fa-trash-o fa-stack-1x fa-inverse"></i>
															</span>
														</a></td>
													</tr>
													</c:when>
													<c:otherwise>
														<tr>
														<td class="text-center">${number}</td>
														<td>${notice.subject}</td>
														<td class="text-right">${notice.name}</td>
														<td class="text-center">
														<fmt:formatDate value="${notice.regdate}" pattern="yyyy-MM-dd" />
														</td>
														<td style="width: 15%;">
														<!-- view(상세보기) -->
														<a href="noticeDetail.do?num=${notice.num}"
															class="table-link"> <span class="fa-stack"> <i
																	class="fa fa-square fa-stack-2x"></i> <i
																	class="fa fa-search-plus fa-stack-1x fa-inverse"></i>
															</span>
														</a>
														<!-- view(상세보기) end--> 
														<a href="#" class="table-link"> <span
																class="fa-stack"> 
																<i
																	class="fa fa-square fa-stack-2x"></i> <i
																	class="fa fa-pencil fa-stack-1x fa-inverse"></i>
															</span>
														</a> <a href="#" class="table-link danger"> <span
																class="fa-stack"> <i
																	class="fa fa-square fa-stack-2x"></i> <i
																	class="fa fa-trash-o fa-stack-1x fa-inverse"></i>
															</span>
														</a></td>
													</tr>
													</c:otherwise>
													</c:choose>
		 											<c:set var="number" value="${number-1 }"/>  
												</c:forEach>
												</tbody>
												</c:otherwise>
												</c:choose>
											</table>
										</div>
								<table border="0" width="700" align="center" >
							<tr align="center">
								<td>
									${pager}
								</td>
							</tr>
						</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<%-- 하단 --%>
				<jsp:include page="../include/bottom.jsp"></jsp:include>
				<%-- 하단 끝 --%>
			</div>
		</div>
	</div>

	<script src="js/demo-skin-changer.js"></script>
	<script src="js/jquery.js"></script>
	<script src="js/bootstrap.js"></script>
	<script src="js/jquery.nanoscroller.min.js"></script>
	<script src="js/demo.js"></script>

	<script src="js/moment.min.js"></script>
	<script src="js/daterangepicker.js"></script>

	<script src="js/scripts.js"></script>

	<script type="text/javascript">
	$(document).ready(function() {
		$('#reportrange').daterangepicker({
			startDate: moment().subtract('days', 29),
			endDate: moment(),
			minDate: '01/01/2012',
			maxDate: '12/31/2014',
			dateLimit: { days: 60 },
			showDropdowns: true,
			showWeekNumbers: true,
			timePicker: false,
			timePickerIncrement: 1,
			timePicker12Hour: true,
			ranges: {
				'Today': [moment(), moment()],
				'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
				'Last 7 Days': [moment().subtract('days', 6), moment()],
				'Last 30 Days': [moment().subtract('days', 29), moment()],
				'This Month': [moment().startOf('month'), moment().endOf('month')],
				'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
			},
			opens: 'left',
			buttonClasses: ['btn btn-default'],
			applyClass: 'btn-small btn-primary',
			cancelClass: 'btn-small',
			format: 'MM/DD/YYYY',
			separator: ' to ',
			locale: {
				applyLabel: 'Submit',
				fromLabel: 'From',
				toLabel: 'To',
				customRangeLabel: 'Custom Range',
				daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
				monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
				firstDay: 1
			}
		 },
		 function(start, end) {
		  console.log("Callback has been called!");
		  $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
		 }
	  );
	  //Set the initial state of the picker label
	  $('#reportrange span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
	  
	});
	</script>
</body>
</html>